<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>奥枫运维鉴权认证</title>
    <link href="/img/icon.ico" rel="shortcut icon"/>
    <link rel="stylesheet" href="/layui/css/layui.css"  media="all">
    <script src="/layui/layui.js" charset="utf-8"></script>
    <script src="/js/jquery.min.js" charset="utf-8"></script>
    <script src="/js/Treatment.js" charset="utf-8"></script>
</head>

<body>

<div>
    <div class="layui-col-md12">
        <blockquote class="layui-elem-quote layui-text" style="margin-top: 15px;">
            <a  class="layui-btn layui-btn-primary layui-border-blue" href="/">返回主页</a>
        </blockquote>
    </div>
    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
        <legend id="tips"></legend>
    </fieldset>

    <form class="layui-form" action="" lay-filter="example">
        <div class="layui-form-item">
            <label class="layui-form-label">密码</label>
            <div class="layui-input-block">
                <input type="password" id="pass"  class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-input-block">
                <button type="button" onclick="checkPass()" class="layui-btn layui-btn-normal">检测</button>
            </div>
        </div>
    </form>
</div>
</body>

<script>
    asyncGet('/getPwdInfo',null,null,function (res) {
        $('#tips').text('从 -->' + res.data  + '填入到下方密码框')
    })

    function checkPass(){
        let input = $('#pass').val()
        console.log(input)
        if (input !== ''){
            asyncPost('/checkPass',{'data':input},Loading('请求中'),function back(res) {
                if (res.code === 200){
                    sessionStorage.setItem('isPassAdopt', 'success');
                    window.location.href='/config';
                }else{
                    error('密码验证错误')
                }
            })
        }
    }



</script>

</html>